import React, { Component } from 'react';
import { Link } from 'react-router-dom';

import 'antd-mobile/lib/flex/style/index.css';

import '../static/styles/goods.css';

class Goods extends Component {
    constructor(props){
        super(props);
    }
    render() {
        return (
            <Link to={`/goods/info/${this.props.data.tbid}/${this.props.data.from}`}>
                <div className={this.props.className}>
                    <div className="goods-img-box">
                        <img className="goods-img" src={this.props.data.goods_pic} />
                        <div className="goods-quan-fee">领券省{this.props.data. quan_fee}元</div>
                    </div>
                    <div className="goods-title">{this.props.data.goods_name}</div>
                    <div className="goods-price">￥{this.props.data.taoke_price}</div>
                    <div style={{ display : this.props.showOldPrice == 0 ? 'none' : 'block'}} className="goods-old-price">原价:￥{this.props.data.sales_price}</div>
                </div>
            </Link>
        );
    }
}

export default Goods;
